package com.hk.commons.entity.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Index;

/**
 * 角色权限
 * 
 * @author saga
 * 
 */
@Entity
@Table(name = "SysRoleResource")
public class SysRoleResource implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7492388690315330314L;

	@Id
	@Column(name = "Id", length = 20)
	private Long id;

	@Column(name = "RoleId", length = 10)
	@Index(name="idx_RoIdResId", columnNames={"roleId", "resourceId"})
	private Long roleId;

	@Column(name = "ResourceId", length = 10)
	private Long resourceId;

	@Column(name = "CreatedTS")
	private Long createdts =  System.currentTimeMillis();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getRoleId() {
		return roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	public Long getResourceId() {
		return resourceId;
	}

	public void setResourceId(Long resourceId) {
		this.resourceId = resourceId;
	}

	public Long getCreatedts() {
		return createdts;
	}

	public void setCreatedts(Long createdts) {
		this.createdts = createdts;
	}
}
